//
//  CommissionPayCell.m
//  EasyToTesco2.0
//
//  Created by 杨森 on 2017/3/21.
//  Copyright © 2017年 EasyToTesco. All rights reserved.
//

#import "CommissionAliPayCell.h"

@implementation CommissionAliPayCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
    
        
         self.bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 0,WIDTH-20,frame.size.height)];
        [self addSubview:_bgView];
        _bgView.backgroundColor = [UIColor grayColor];
        _bgView.layer.masksToBounds = true;
        _bgView.layer.cornerRadius = 5;
        
        
        UIImageView *logoImg = [[UIImageView alloc] init];
        [_bgView addSubview:logoImg];
        logoImg.image = [UIImage imageNamed:@"icon_alipay_white"];
        
        self.alipayName = [[UILabel alloc] init];
        _alipayName.textColor = [UIColor whiteColor];
        [_bgView addSubview:_alipayName];
        _alipayName.font = FONT(16);
       
        
        
        self.alipayNumber = [[UILabel alloc] init];
        _alipayNumber.textColor = [UIColor whiteColor];
        [_bgView addSubview:_alipayNumber];
        _alipayNumber.font = FONT(15);
        
        
        [logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(_bgView.mas_centerY);
            make.left.equalTo(_bgView.mas_left).offset(10);
            make.width.height.mas_equalTo(_bgView.Height/3*2);
        }];
        
        [_alipayName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(_bgView.mas_centerY);
//            make.top.equalTo(bgView.mas_top).offset(10);
            make.left.equalTo(logoImg.mas_right).offset(15);
        }];
        
        [_alipayNumber mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_bgView.mas_centerY);
            make.left.equalTo(logoImg.mas_right).offset(15);
        }];
        
    }
    return self;
}


@end
